<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="shortcut icon" href="../favicon.ico" />
    <title>Document</title>
  </head>

  <body>
    <!-- 引入顺序必须按照先引入核心库的顺序，否则报错  -->
    <div id="root"></div>

    <script src="../js/react.development.js"></script>

    <!-- <script src="../js/prop-types.js"></script> 目前没什么用 -->
    <script src="../js/react-dom.development.js"></script>
    <script src="../js/babel.min.js"></script>

    <script type="text/babel">

//              <li>A</li>
//             <li>B</li>
//             <li>C</li>
      const data = ['A', 'B', 'C'];
      const VDOM = (
        <div>
        <h1>遍历输出数组</h1>
          <ul>
            {
                data.map((item,index)=> {
                    return  <li key={index}> {item} </li>
                })
            }
          </ul>
        </div>
      );
      ReactDOM.render(VDOM, document.getElementById("root"));
    </script>
  </body>
</html>
